package com.example.lpactivity.fragment.news;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.lpactivity.R;

public class NewsContentFragment extends Fragment {

    private TextView tv_tile, tv_content;
    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.news_content_fragment, container, false);
        initViews();
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }

    private void initViews() {
        tv_tile = view.findViewById(R.id.tv_title);
        tv_content = view.findViewById(R.id.tv_content);
    }

    public void loadData(News news) {
        tv_tile.setText(news.getTitle());
        tv_content.setText(news.getContent());
    }


}
